﻿using System.Diagnostics;
using System.Linq;
using MongoDB.Driver.Linq;

namespace eCommMongo.Core
{
    public static class MongoQueryableExtension
    {
        public static string ToMongoQueryText<TQueryable>(this IQueryable<TQueryable> query)
        {
            return (query as MongoQueryable<TQueryable>).GetMongoQuery().ToString();
        }

       
        public static void DebugWriteMongoQueryText<TQuerable>(this IQueryable<TQuerable> query)
        {
            //Debug.WriteLine("QUERY: " + query.ToMongoQueryText());
        }
    }
}